Repository navigation
Conversation
## summary - Add `scripts/bench_motion_paths.py` to run isolated Main Chat and built-in Motion Director + publish trials, verify persisted 30s `motion` documents and H.264 `video` assets, decompose end-to-end wall time into `model`, `cliDiscoveryAndExec`, `inspectFrames`, `renderAndPublish`, and `unattributed`, and export sanitized trace archives. - Add unit and FastAPI route-contract tests in `tests/test_bench_motion_paths.py` covering stage classification, disjoint interval partitioning, Motion Director streaming tool deltas, deliverable verification, and trace redaction. - Record the 3x2 controlled baseline on `9f24de14` (`deepseek-flash`, `thinking=low`) and trace-backed bottleneck diagnosis in bilingual docs (`docs/development/motion-path-benchmark.md` and `.zh-CN.md`), indexed in `docs/README.md`. Fixes ThinkFlowLab#654 Refs ThinkFlowLab#632
## summary - Require `ffprobe` availability and validate H.264 codec, 1920x1080 dimensions, 30fps frame rate, and reopened `CreationProjects` disk snapshots in `scripts/bench_motion_paths.py`. - Scrub relative and ancestor workspace path segments and git worktree parent paths in `sanitize_text`, with regression assertions in `tests/test_bench_motion_paths.py`. - Correct `MotionGeneration` `deepseek-flash` `max_tokens` figures (`32768` at `off`/`auto`, `65536` at `low`/`medium`, `131072` at `high`) in bilingual benchmark documentation. Refs ThinkFlowLab#654
## summary - Count one Motion Director model step per streamed LLM batch rather than per sequential or parallel tool execution, and attribute inter-tool batch gaps to cliDiscoveryAndExec. - Exclude post-publish object.get enrichment RPCs from Main Chat renderCalls and inspectCalls, keep scripts/ out of sys.path before importing opendirector, and add a reanalyze subcommand. - Add multi-tool batch, enrichment filtering, and subprocess CLI regression coverage, and refresh the bilingual baseline tables. Refs: ThinkFlowLab#654
david6666666
left a comment
There was a problem hiding this comment.
REQUEST CHANGES 8b2ab12 Fixes #654; Refs #632
我下载并核对了六轮 trace,五个成片均可解码,两条路径各抽看一条。作者这组数据 Main Chat 成功 2/3,Motion Director 3/3;live 数据来自 9f24de1,不是当前 head 的复跑。建议把 SSE/SQLite 归因改成假设:56.6s 和 11.8s 是未归属余量,没有单独计到落库。两条路径的有效 token budget 和 CLI discovery 版本也应并排记录,避免把整条路径差异说成单个机制的收益。
Ran: 同 head Release 47307414596、CodeQL、DSH 通过;离线核验了作者 trace 与成片。Not run: 当前 head 的 live provider 基准。78/100(范围 3、正确性 2、验证 3、证据 2、简洁性 2;每项满分 3)。Dot,代表 @david6666666,非表决。
| 3. **Repeated full 900-frame MP4 renders during self-review (`renderAndPublish`: `+54.0s` mean; `2–3` full renders vs `1`):** | ||
| - `motion_director` verifies layout and motion exclusively with warm-Chrome `inspect_frames` (`1.1–2.7s` across `2–4` calls) and renders the 900-frame MP4 once (`59.6–64.2s`) when publishing. | ||
| - `main_chat` executed `2` full `opendirector motion render` passes in trial 2 (`48.39s` draft + `48.13s` publish = `96.8s`) and `3` full passes in trial 3 (`44.82s` + `44.32s` + `45.17s` = `134.6s`), rendering intermediate MP4 drafts before final publication. | ||
| 4. **Harness SSE/SQLite delta-persistence overhead on large reasoning streams (`unattributed`: `56.6s` in trial 2, `11.8s` in trial 3):** |
There was a problem hiding this comment.
这里把 unattributed 直接归给了 SSE/SQLite,但它也包含启动和步间调度。建议两版文档先写为待验证假设;要给落库定量,再加独立计时或同 workload 的受控 A/B。Dot,代表 @david6666666。
There was a problem hiding this comment.
Addressed in 4db9df78 / 72b0324d: reframed unattributed (56.6s in trial 2, 11.8s in trial 3, 4.5s in failed trial 1) in both docs/development/motion-path-benchmark.md and docs/development/motion-path-benchmark.zh-CN.md (as well as the PR summary) as the unattributed wall-clock residual bundling harness startup, inter-step orchestration, and client-side event handling without separate persistence timers, and moved OpenCode SSE/SQLite delta persistence and worktree snapshotting to an explicit unverified hypothesis requiring sub-stage timers or a same-workload A/B test. Also added a side-by-side comparison table of both paths' effective output token budgets (65536 with reserve_reasoning=True at low/medium vs 8192 CHAT_MAX_TOKENS without reserve_reasoning, plus UI thinking="auto" mappings) and the 9f24de14 CLI/skill discovery surface so the 2.53x ratio is explicitly presented as a combined multi-factor path delta.
david6666666
left a comment
There was a problem hiding this comment.
REQUEST CHANGES 8b2ab12 Fixes #654; Refs #632
补两条会影响后续复用的验收问题:--resume 不核对实验配置就复用旧 trial;交付 verifier 分别挑 Motion editor 和 MP4,没确认两者来自同一次 publish,而且磁盘重开缺失时仍能用 API snapshot 判通过。建议各加一个 CPU fixture,不需要重跑这六次模型请求。没有证据表明作者已提交的六轮混用了配置;此前核验的五个 MP4 仍可解码。
Ran: 核对同 head 源码和已通过的 Release checks。Not run: 未执行 PR benchmark 或调用 provider。更新为 63/100(范围 3、正确性 1、验证 2、证据 2、简洁性 2;每项满分 3)。Dot,代表 @david6666666,非表决。
| for path_name in selected_paths: | ||
| trial_dir = runs_dir / f"{path_name}-run-{trial_idx:02d}" | ||
| existing_result = trial_dir / "trial_result.json" | ||
| if options.resume and existing_result.is_file(): |
There was a problem hiding this comment.
这里只看 path 和 trial 序号。沿用同一目录但改了 prompt、thinking、model 或 runtime 时,旧 trial 会混进用新配置标注的 summary。建议首次 dispatch 前写入不含凭据的 experiment fingerprint;加一个改配置后 resume 会在调用 provider 前拒绝的 CPU fixture。Dot,代表 @david6666666。
There was a problem hiding this comment.
Addressed in 4db9df78 / 72b0324d: command_run now resolves public model metadata in memory and runs prepare_experiment_manifest to write/verify a credential-free experiment.json SHA-256 fingerprint (commitSha, prompt, thinking, runtime, public model metadata, and canvas spec) before writing isolated-root/.opendirector/models.json, spawning the isolated server, or dispatching any provider calls, and stamps experimentFingerprint into trial_result.json and summary.json. Added CPU regression test test_command_run_resume_rejects_config_changes_before_provider_dispatch verifying fail-fast rejection across prompt, thinking, model, runtime, commitSha, and missing experiment.json prior to server/provider dispatch while preserving existing isolated-root files.
| ] | ||
| selected_video_item: dict[str, Any] | None = None | ||
| selected_video_asset: dict[str, Any] | None = None | ||
| for item in reversed(video_items): |
There was a problem hiding this comment.
这里找的是最后一个可见 MP4,不一定是前面那个 Motion editor 发布的。建议用实际 publish receipt 将 editor ID、冻结 revision(或内容 digest)和 asset ID 一起绑定,在磁盘重开后核对。加一个规格全对但来自别的 editor 的视频 fixture,应该判失败。Dot,代表 @david6666666。
There was a problem hiding this comment.
Addressed in 4db9df78 / 72b0324d: removed the HTTP snapshot fallback from verify_project_deliverables (load_reopened_disk_project now reopens the project and commit history directly from disk via CreationProjects(LocalProjects(...)) or fails with disk_reopen_failed) and bound the trial's publish_receipt to the applied canvas.publishMedia commit in disk history — cross-checking commandId, sourceItemId, sourceEditorId + expectedVersions revision, frozen executionDocumentId + canonical MotionDocument SHA-256 digest agreement with the live editable motion document, outputItemId, assetId, asset.provenance, on-disk MP4 SHA-256 bytes, and ffprobe. Expanded test_verify_project_deliverables_checks_motion_document_and_published_video with real CreationProjects + publish_rendered_motion_mp4 CPU fixtures rejecting missing disk reopen, spec-valid MP4s published from a foreign Motion editor (including hidden foreign source + visible target Motion node), tampered sourceEditorId, and post-publish editor divergence.
## summary - Require disk reopen via CreationProjects without falling back to the HTTP snapshot, and bind the returned canvas.publishMedia receipt, source editor ID/revision, frozen execution document digest, output canvas item, video asset provenance, and SHA-256 bytes together. - Persist a credential-free experiment.json configuration fingerprint before dispatching trials and reject mismatched --resume runs before starting the server or invoking any model provider. - Add CPU regression fixtures for missing disk reopen, foreign-editor MP4 rejection, post-publish editor divergence, and --resume config mismatch; document side-by-side path budgets/CLI version and reframe SSE/SQLite attribution within unattributed as a hypothesis. Refs: ThinkFlowLab#654, ThinkFlowLab#632
## summary - Resolve selected model metadata in memory and run `prepare_experiment_manifest` before creating `isolated-root` or writing `isolated-root/.opendirector/models.json`, preserving existing experiment credentials on rejected `--resume` invocations. - Select the latest applied `canvas.publishMedia` commit on legacy reanalysis fallback, remove duplicate fingerprint spread in `command_reanalyze`, mark `tests/test_bench_motion_paths.py` with `cpu` and `ready`, and align Stage 5 wording in both locales. Refs: ThinkFlowLab#654 Refs: ThinkFlowLab#632
## summary - Merge `origin/main` (`8cdf67ec`) into `perf/motion-path-benchmark-654`. - Register `tests/test_bench_motion_paths.py` in the `core` shard of `scripts/ci/python_shards.json` introduced in `ThinkFlowLab#692`. Refs: ThinkFlowLab#654 Refs: ThinkFlowLab#632
|
Updated to
|
david6666666
left a comment
There was a problem hiding this comment.
COMMENT(非表决) 72b0324 Fixes #654; Refs #632
技术意见:建议修完再合。当前证据暂定 72/100,非批准分(范围 3、正确性 2、验证 2、主张证据 2、简洁度 2)。下载复核了新版 trace ZIP:23 个文件、6 个 trial 的 fingerprint 一致,5 个成功 trial 有 publishBinding,原始实验仍是 9f24de14。文档现在把 2.53× 当多因素整路径差异,磁盘重开和发布绑定也补了,不需要为这轮复核再跑模型。
还剩一个会误复用旧结果的边界:fingerprint 只保存模型服务 hostname,同域名但不同 API 路径或端口会被当成同一配置。我在对应行标了建议。同 SHA Release 只剩三项基线测试漏登记,自己的 benchmark 模块已登记。未独立调用 provider。Dot,代表 @david6666666。
| "model": { | ||
| "id": str(model_meta.get("id") or ""), | ||
| "modelId": str(model_meta.get("modelId") or ""), | ||
| "host": model_meta.get("host"), |
There was a problem hiding this comment.
这里用 host 代表服务,但同一网关的不同 port/base path 可以路由到不同版本。换 endpoint 后 --resume 仍会接受同一批旧 trial。建议把去掉凭据和 query 的 normalized endpoint(scheme、host、port、base path)纳入 fingerprint,补同 host 不同 path 的 CPU test,确认在 provider dispatch 前拒绝。Dot,代表 @david6666666。
Summary
scripts/bench_motion_paths.pyto execute controlled, isolated comparisons between Main Chat (/api/creation/projects/{id}/assistant/turns) and built-in Motion Director + canvas publication (/api/creation/motion/chat+editor.save+publish-prepare+render-jobs+publish), guard--resumewith a credential-freeexperiment.jsonSHA-256 configuration fingerprint before server/provider dispatch, require disk reopen viaCreationProjects(without HTTP snapshot fallback) bound to the appliedcanvas.publishMediareceipt (sourceEditorId, frozenexecutionDocumentId+ content digest,outputItemId,assetId, SHA-256 bytes, andffprobe), decompose end-to-end wall time into five mutually exclusive stages (model,cliDiscoveryAndExec,inspectFrames,renderAndPublish,unattributed), and export sanitized trace archives.CreationProjectsCPU regression tests intests/test_bench_motion_paths.pycovering CLI stage classification, post-publishobject.getenrichment filtering, disjoint nested-interval partitioning, Motion Director streamingtool_call_deltaand multi-tool batch step accounting, mandatory disk reopen, foreign-editor MP4 and post-publish divergence rejection,--resumeconfig-mismatch rejection prior to provider dispatch, and trace redaction.deepseek-flash,thinking="low", prompt做个OpenDirector 30s的动效动画) and trace-backed bottleneck diagnosis in bilingual documentation (docs/development/motion-path-benchmark.mdanddocs/development/motion-path-benchmark.zh-CN.md), indexed indocs/README.md. No product runtime behavior is modified in this PR; candidate optimization hypotheses are isolated for follow-up validation against this baseline.Linked issue
Fixes #654
Refs #632
Fixes #NorRefs #Nis included, or no issue appliesLabels
Intended labels:
type:ci,area:agent,area:performance,area:docs,modality:video(fork contributors cannot apply labels directly; left to repository label automation / maintainers).Test plan
72b0324d9b6ac273a23e800382b9ae89d52c1dc9merged withorigin/main8cdf67ec32d1ba5da8c3eef63d013267e714e9b7):.venv/bin/python -m pre_commit run --from-ref origin/main --to-ref HEAD(passed).venv/bin/python -m pytest tests/test_bench_motion_paths.py -v(10 passed).venv/bin/python scripts/ci/check_test_layers.py --list-shard core(liststests/test_bench_motion_paths.pyonce).venv/bin/python -m pytest tests --collect-only -qq --ci-profile=/tmp/od-pr680-inventory.json && .venv/bin/python scripts/ci/check_test_layers.py --profile /tmp/od-pr680-inventory.json(3868 tests, 152 representatives, layer contract passed; note perdocs/development/lessons.md:tests/test_ci_layers.py::test_repo_python_shards_manifest_covers_every_test_module_oncefails identically on upstreamorigin/main8cdf67ec32d1ba5da8c3eef63d013267e714e9b7because#676[tracked in#695] and#681did not registertests/test_ark_availability.py,tests/test_trace_job_queries.py, andtests/test_wait_outcome.py, while the other 20test_ci_layers.pytests pass)npm test(1115 passed, 0 failed).venv/bin/lint-imports(4 contracts kept, 0 broken).venv/bin/python scripts/generate_contracts.py --check(passed)npm run check:i18n(3859 keys, 0 problems)npm run check:browser-locale(102 pages, 0 problems)npm run check:browser-manifest(112 entries, OK)npm run build(passed)Release checks(.github/workflows/ci.yml->release-checks.yml):static,python3-shard matrix (core,agent-cli,media),python-native(Bundled OpenCode model gateway regressionwithOPENDIRECTOR_REAL_CLI=1+Native Harness visual regression),frontend(wheel build +verify_install.py),browsermatrix (isolated,voice,assistant),desktopinstallers smoke (desktop-installers.yml, triggered becausescripts/is inDESKTOP_INPUT_DIRS), andchecksaggregate gate.CodeQL(security-extended),DSH plugin checks(scope-skip), andReviewer routing.AGENTS.md):83/100(Scope and intent 3/3,Correctness and safety 3/3,Validation 2/3,Claim evidence 2/3,Simplicity 3/3)origin/main):8cdf67ec32d1ba5da8c3eef63d013267e714e9b772b0324d9b6ac273a23e800382b9ae89d52c1dc972b0324d9b6ac273a23e800382b9ae89d52c1dc9(andRelease checks / python (core)+checkscurrently have an upstream baseline failure onorigin/main8cdf67ecpending#695/#681shard registration); live 3x2deepseek-flashtrials ran on9f24de145389dab2186944d6fcc79acee5492dad(origin/mainat run start) on Apple Silicon macOS (motion_*,model_gateway.py, andstream_motion_director_chatwere untouched across9f24de14..8cdf67ec, while#612,#662,#664, and#681updatedcli.py,agent/tools.py,agent/gateway.py, andagent/native.py).Evidence that it works
9f24de145389dab2186944d6fcc79acee5492dad):Darwin 27.2.0 arm64), Python3.12.9, Node.jsv24.22.2, FFmpeg8.0.1, bundledopencode-ai1.19.5(defaultruntime) vs built-instream_motion_director_chat(MAX_AGENT_STEPS=12).OPENDIRECTOR_ROOT, fresh empty project per trial,deepseek-flash(api.deepseek.com),thinking="low"on both paths (thinking: {"type": "enabled"}, reasoning_effort: "low"), prompt做个OpenDirector 30s的动效动画,1920x1080@30fps.model(s)cliDiscoveryAndExec(s)inspectFrames(s)renderAndPublish(s)unattributed(s)--helpProbesmotion_directormotion_directormotion_directormain_chatreason=length)main_chatmain_chatPrimary bottleneck stages identified from traces (note: the two paths differ across harness loop,
65536vs8192output token budget, CLI/skill discovery surface at9f24de14, and render cadence simultaneously, so2.53xis the combined multi-factor path delta rather than a single-mechanism gain):model(252.8svs131.4smean on succeeded runs;main_chattrial 1 failed onstep_finish.reason="length"):ModelGatewayenforcesCHAT_MAX_TOKENS = 8192withoutreserve_reasoning, exhausting all8192tokens inside reasoning (output=0) while planning the single-pass 30sMotionDocumentwrite in trial 1 (40be830322c67e1d) and forcing50–75sequential model turns on trials 2–3 vs8–13in Motion Director (32768atoff/auto,65536atlow/medium,131072athigh). Under default UIthinking="auto",chat_payloadalso mapsapi.deepseek.com"auto"->reasoning_effort="high"(max_tokens=8192) whereas_motion_thinkingmapsdeepseek-flash"auto"->"off"(max_tokens=32768).cliDiscoveryAndExec(84.6svs0.27smean;137.4sinmain_chattrial 3):builtin_skills()omitspackages/agent/motion-skills/motion-directorwhileopendirector motion skillshints at the non-existent.opendirector/motion-skillsoverride directory, triggering filesystem searches (mdfind,find <home>, and a120.1sfind /timeout in trial 3) plus--help-fieldand source greps in all 3 Main Chat runs.renderAndPublish(115.7svs61.7smean): Main Chat executed2–3full 900-frameopendirector motion renderpasses (2in trial 2 =96.8s,3in trial 3 =134.6s) during self-review instead of iterating withmotion inspectand rendering MP4 once at publication.unattributed(34.2svs0.001smean;56.6sinmain_chattrial 2,11.8sin trial 3,4.5sin failed trial 1): unattributed wall-clock residual outside the four timed buckets, bundling harness startup, inter-step orchestration, and client-side event handling without separate persistence timers. Whether OpenCode SSE/SQLite delta persistence or worktree snapshotting dominates the48.1spost-stream gap in trial 2 (2.46 MB/7846reasoning tokens across7844SSE chunks) is recorded as an unverified hypothesis pending sub-stage timers or a same-workload A/B test.Reviewable artifacts (measured on
9f24de145389dab2186944d6fcc79acee5492dad):main_chatfailed trial 1): motion-benchmark-654-traces.zip1920x108030fpsH.264 MP4 outputs verified on disk viaCreationProjects+ffprobe:185.1s,1.59 MB): motion-director-run-01.mp4195.1s,0.74 MB): motion-director-run-02.mp4206.3s,1.30 MB): motion-director-run-03.mp4371.6s,1.28 MB): main-chat-run-02.mp4616.8s,0.79 MB): main-chat-run-03.mp4Applicable evidence attached and any visual N/A explained
Provider verification
Automated tests in
tests/test_bench_motion_paths.pyuse synthetic trace fixtures,monkeypatchedffprobemetadata, and an in-process FastAPITestClient; they make zero live model-provider calls.The 6 benchmark trials documented in
docs/development/motion-path-benchmark.mdmade real API calls tohttps://api.deepseek.com/v1(deepseek-flash) using local credentials stored outside Git; no other providers (openai,minimax,kling,bigmodel, etc.) or external harnesses (codex,claude,deepseekCLI,pi,antigravity,jiuwenswarm) were exercised in this controlled run.Real-provider calls are described honestly, or none were made
Bilingual UI
No UI or backend user-facing message catalogs changed.
New developer documentation is delivered in both English (
docs/development/motion-path-benchmark.md) and Simplified Chinese (docs/development/motion-path-benchmark.zh-CN.md) and indexed indocs/README.md.Both locales are updated, or no user-facing copy changed